package com.bwie.system.mapper;

import com.bwie.common.doamin.dto.LoginDTO;
import com.bwie.common.doamin.dto.RegisterDTO;
import com.bwie.common.doamin.model.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @className: SysUserMapper
 * @Description: TODO
 * @version: v1.８.0
 * @author: 刘洋朔
 * @date: 2025/9/9 10:50
 */
@Mapper
public interface SysUserMapper {
    /**
     * 获取登录的用户信息
     * @param loginDTO
     * @return
     */
    SysUser selectLoginInfo(LoginDTO loginDTO);

    /**
     * 唯一校验
     * @param phone
     * @return count
     */
    int selSinglePhone(@Param("phone") String phone);

    /**
     * 确认无误进行新增用户
     * @param registerDTO
     */
    void insertNewUser(RegisterDTO registerDTO);

    /**
     * 获取登录的角色id
     * @param userId
     * @return
     */
    Long selRoleByUserId(@Param("userId") Long userId);

    /**
     * 为新用户绑定角色
     * @param userId
     */
    void insertNewRole(@Param("userId") Long userId);
}
